package com.leetcode.LC_MED;

public class LC538_2 {
    int num = 0;
    private TreeNode convertBST(TreeNode root) {
        if (root!=null){
            convertBST(root.right);
            root.val +=num;
            num = root.val;
            convertBST(root.left);
            return root;
        }
        return null;
    }
}
